﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Diablo3.Engine.Property
{
    /// <summary>
    /// 格挡值
    /// </summary>
    public class BlockValue : ItemsProperty,IAffecteBlockValue
    {
        public BlockValue() { }

        public BlockValue(Double minValue, Double maxValue)
        {
            MinValue = minValue;
            MaxValue = maxValue;
        }

        /// <summary>
        /// 最小值
        /// </summary>
        public Double MinValue { get; set; }

        /// <summary>
        /// 最大值
        /// </summary>
        public Double MaxValue { get; set; }

        public override string Des
        {
            get { return String.Format("{0}-{1} 格挡", MinValue, MaxValue); }
        }

        #region IAffecteBlockValue 成员

        double IAffecteBlockValue.Affecte(double source)
        {
            return source + (MinValue + MaxValue) / 2;
        }

        #endregion

        #region IAffecteBlockValue 成员

        double IAffecteBlockValue.AffecteMax(double source)
        {
            return source + MaxValue;
        }

        double IAffecteBlockValue.AffecteMin(double source)
        {
            return source + MinValue;
        }

        #endregion
    }
}
